package com.bifrost.model.vo;

import com.bifrost.entity.OrderItem;
import com.bifrost.entity.OrderReturnItem;
import com.bifrost.entity.TransactionSendLog;
import com.bifrost.model.sap.RetailItem;
import com.bifrost.util.DateTimeUtil;

import java.io.Serializable;
import java.util.Date;

/**
 * Author by yanxiaobo
 * Date on 2018/6/20$.
 */
public class TransactionVO implements Serializable{
    private String storeCode;
    private String externalId;
    private String createDate;
    private String reason;

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }

    public String getExternalId() {
        return externalId;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public TransactionVO(){

    }

    /**
     *
     * @param log
     * @param o 是OrderItem或者OrderReturnItem类型
     */
    public TransactionVO(TransactionSendLog log,RetailItem retailItem,String reason) {
        this.storeCode = log.getStroeCode();
        this.createDate = DateTimeUtil.dateToStr(log.getCreateDate());
        this.externalId = retailItem.getItemId();
        this.reason = reason;
    }

}
